using System;

namespace OpenRay
{
	public delegate float FloatFunc(float[] point);
	
	public class ProceduralComponent : IProceduralComponent
	{
		private readonly FloatFunc func;
		
		public ProceduralComponent (FloatFunc f)
		{
			func = f;
		}
		
		public float Evaluate (Point modelHit)
		{
			float[] temp = new float[3];
			temp[0] = modelHit.X;
			temp[1] = modelHit.Y;
			temp[2] = modelHit.Z;
			
			return func(temp);
		}
	}
}

